package com.i.me.login;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.i.me.R;
import com.library.base.mvp.BaseAty;

import butterknife.BindView;
import butterknife.OnClick;

public class LoginAty extends BaseAty<LoginP> implements LoginContral.View {

    @BindView(R.id.et_user_name)
    EditText etUserName;
    @BindView(R.id.et_password)
    EditText etPassword;
    @BindView(R.id.btn_login)
    public Button btnLogin;

    @Override
    protected LoginP initPresenter() {
        return new LoginP();
    }

    @Override
    protected void initData() {
    }

    @Override
    protected void initView() {
//        btnLogin = findViewById(R.id.btn_login);
//        btnLogin.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                Toast.makeText(LoginAty.this,"11111111",Toast.LENGTH_SHORT).show();
//                mPresenter.login("","");
//            }
//        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.aty_login;
    }

    @Override
    public void onError(Throwable throwable) {

    }

    @Override
    public void success() {

    }

    @OnClick({R.id.btn_login})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_login:
                mPresenter.login(etUserName.getText().toString().trim(), etPassword.getText().toString().trim());
                break;
        }
    }
}
